/**
 * Created by Administrator on 2016/10/25.
 */

PlayerModel = jGame.ModelObject.extend({

    ctor: function (id) {
        var player = this.loadData("PLAYER_"+id, {"id":id, "hp":100, "mp":100});
        this._super(player);
    },

    getId: function () {
        return this.getData("id");
    },

    addHp: function (num) {
        this.setData("hp", this.getHp() + num);
    },

    getHp: function () {
        return this.getData("hp");
    },

    addMp: function (num) {
        this.setData("mp", this.getMp() + num);
    },

    getMp: function () {
        return this.getData("mp");
    },
    
})